﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="TranslationServiceModule.cs" company="WordSteps.com">
//   All rights reserved
// </copyright>
// <summary>
//   Defines the Module type.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace RapidDict.Modules.TranslationService
{
    using Microsoft.Practices.Composite.Modularity;
    using Microsoft.Practices.Unity;
    using RapidDict.Infrastructure.Interfaces;
    using RapidDict.Modules.TranslationService.Services;

    [Module(ModuleName = "TranslationServiceModule")]
    [ModuleDependency("LanguagePairServiceModule")]
    public class TranslationServiceModule : IModule
    {
        IUnityContainer container;

        public TranslationServiceModule(IUnityContainer container)
        {
            this.container = container;
        }

        public void Initialize()
        {
            var languagePairService = this.container.Resolve<ILanguagePairService>();
            this.container.RegisterInstance<ITranslationService>(new TranslationService(languagePairService));
        }
    }
}